//
//  ViewController.m
//  start
//
//  Created by lanou3g on 15-4-20.
//  Copyright (c) 2015年 red. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()<iCarouselDataSource,iCarouselDelegate>

@property (nonatomic,strong)UICollectionView *collectionView;

@property (nonatomic,strong)NSMutableArray *array;

@end

@implementation ViewController



- (void)viewDidLoad {
    [super viewDidLoad];
    _array = @[@"1.jpg",@"2.jpg",@"3.jpg",@"4.jpg",@"5.jpg"].mutableCopy;
    
    [self setupCaousel];

    NSLog(@"hdfghgjfgjfjhjhj");

    NSLog(@"30");

    NSLog(@"fred0_");

    NSLog(@"再来");
    NSLog(@"第二次");
    

    NSLog(@"第四次");

    NSLog(@"来的更猛烈些吧");

    
    NSLog(@"又来。、、、、、");
    
    NSLog(@"practice");
    
    NSLog(@"pra3");
    
    NSLog(@"pra4");
    
    _wrap = YES;
}

- (IBAction)selectAction:(id)sender {
    CollectionViewController *show = [[CollectionViewController alloc] init];
    [self.navigationController pushViewController:show animated:YES];
}

- (void)setupCaousel{
    _carousel = [[iCarousel alloc] initWithFrame:CGRectMake(0,54,self.view.bounds.size.width,220)];
    _carousel.backgroundColor = [UIColor blackColor];
    [self.view addSubview:_carousel];
    
    _carousel.delegate = self;
    _carousel.dataSource = self;
    
    _carousel.type = iCarouselTypeCoverFlow;
}

- (void)setupView{
    
    
    
    
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}



- (NSUInteger)numberOfItemsInCarousel:(iCarousel *)carousel
{
    return _array.count;
}

- (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index{
    
    UIView *view = [[UIImageView alloc] initWithImage:[UIImage imageNamed:[NSString stringWithFormat:@"%@",_array[index]]]];
    view.frame = CGRectMake(60,20,self.view.bounds.size.width-100,190);
    
    return view;
}

- (BOOL)carouselShouldWrap:(iCarousel *)carousel
{
    return _wrap;
}

@end
